class Solution:
    def countGoodTriplets(self, arr , a: int, b: int, c: int):
        i=0
        result=[]
        while i<len(arr)-2:
            j=i+1
            while j<len(arr)-1:
                k=j+1
                while k<len(arr):
                    if abs(arr[i]-arr[j])<=a and abs(arr[j]-arr[k])<=b and abs(arr[i]-arr[k])<=c:
                        result.append((arr[i],arr[j],arr[k]))
                    k+=1
                j+=1
            i+=1
        return len(result)


